package com.ntschy.bt.entity.enums.btpolicyEnum;


import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BtPolicyTypeEnum implements IEnum<Integer> {
    /**
     * 政策类型：
     * 1-产业发展 industrial development
     * 2-科技人才technology talents
     * 3-金融financial
     * 4-土地 land
     * 5-安全生产safety production
     */
    INDUSTRIAL_DEVELOPMENT(1, "产业发展"),
    TECHNOLOGY_TALENTS(2, "科技人才 "),
    FINANCIAL_INFO(3, "金融"),
    LAND_INFO(4, "土地"),
    SAFETY_PRODUCTION(5, "安全生产");

    private final int value;

    private final String desc;

    BtPolicyTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }


    @JsonCreator
    public static BtPolicyTypeEnum getBtPolicyTypeEnumValue(int value) {
        for (BtPolicyTypeEnum companyType : BtPolicyTypeEnum.values()) {
            if(companyType.getValue() == value) {
                return companyType;
            }
        }
        return null;
    }
}
